package ink.lovejinhu.think.tree;

import ink.lovejinhu.common.TreeNode;

/**
 * @author jinhu
 * created 2021-05-08 14:25
 */
public class SolveTreeModel {
    /**
     * 二叉树的题目:明确当前节点要做的事其余交给框架(即递归调用)
     * 前序调用
     */
    public void print(TreeNode root) {
        if (root == null) {
            return;
        }
        System.out.println(root.val);   //这是打印树当前节点
        print(root.left);
        print(root.right);
    }

}
